/**
 * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.vijayan.profile.service.base;

import com.liferay.counter.service.CounterLocalService;

import com.liferay.portal.kernel.annotation.BeanReference;
import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.service.ResourceLocalService;
import com.liferay.portal.service.ResourceService;
import com.liferay.portal.service.UserLocalService;
import com.liferay.portal.service.UserService;
import com.liferay.portal.service.persistence.ResourcePersistence;
import com.liferay.portal.service.persistence.UserPersistence;

import com.vijayan.profile.model.MyExpectation;
import com.vijayan.profile.service.FamilyMemberLocalService;
import com.vijayan.profile.service.FamilyMemberService;
import com.vijayan.profile.service.HoroscopeLocalService;
import com.vijayan.profile.service.HoroscopeService;
import com.vijayan.profile.service.MyExpectationLocalService;
import com.vijayan.profile.service.MyExpectationService;
import com.vijayan.profile.service.MyPhotoLocalService;
import com.vijayan.profile.service.MyPhotoService;
import com.vijayan.profile.service.ProfileLocalService;
import com.vijayan.profile.service.ProfileService;
import com.vijayan.profile.service.persistence.FamilyMemberPersistence;
import com.vijayan.profile.service.persistence.HoroscopePersistence;
import com.vijayan.profile.service.persistence.MyExpectationPersistence;
import com.vijayan.profile.service.persistence.MyPhotoPersistence;
import com.vijayan.profile.service.persistence.ProfilePersistence;

import java.util.List;

import javax.sql.DataSource;

/**
 * The base implementation of the my expectation local service.
 *
 * <p>
 * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.vijayan.profile.service.impl.MyExpectationLocalServiceImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. Always use {@link com.vijayan.profile.service.MyExpectationLocalServiceUtil} to access the my expectation local service.
 * </p>
 *
 * @author vijayan
 * @see com.vijayan.profile.service.impl.MyExpectationLocalServiceImpl
 * @see com.vijayan.profile.service.MyExpectationLocalServiceUtil
 * @generated
 */
public abstract class MyExpectationLocalServiceBaseImpl
	implements MyExpectationLocalService {
	/**
	 * Adds the my expectation to the database. Also notifies the appropriate model listeners.
	 *
	 * @param myExpectation the my expectation to add
	 * @return the my expectation that was added
	 * @throws SystemException if a system exception occurred
	 */
	public MyExpectation addMyExpectation(MyExpectation myExpectation)
		throws SystemException {
		myExpectation.setNew(true);

		return myExpectationPersistence.update(myExpectation, false);
	}

	/**
	 * Creates a new my expectation with the primary key. Does not add the my expectation to the database.
	 *
	 * @param exceptationId the primary key for the new my expectation
	 * @return the new my expectation
	 */
	public MyExpectation createMyExpectation(long exceptationId) {
		return myExpectationPersistence.create(exceptationId);
	}

	/**
	 * Deletes the my expectation with the primary key from the database. Also notifies the appropriate model listeners.
	 *
	 * @param exceptationId the primary key of the my expectation to delete
	 * @throws PortalException if a my expectation with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public void deleteMyExpectation(long exceptationId)
		throws PortalException, SystemException {
		myExpectationPersistence.remove(exceptationId);
	}

	/**
	 * Deletes the my expectation from the database. Also notifies the appropriate model listeners.
	 *
	 * @param myExpectation the my expectation to delete
	 * @throws SystemException if a system exception occurred
	 */
	public void deleteMyExpectation(MyExpectation myExpectation)
		throws SystemException {
		myExpectationPersistence.remove(myExpectation);
	}

	/**
	 * Performs a dynamic query on the database and returns the matching rows.
	 *
	 * @param dynamicQuery the dynamic query to search with
	 * @return the matching rows
	 * @throws SystemException if a system exception occurred
	 */
	@SuppressWarnings("rawtypes")
	public List dynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return myExpectationPersistence.findWithDynamicQuery(dynamicQuery);
	}

	/**
	 * Performs a dynamic query on the database and returns a range of the matching rows.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param dynamicQuery the dynamic query to search with
	 * @param start the lower bound of the range of model instances to return
	 * @param end the upper bound of the range of model instances to return (not inclusive)
	 * @return the range of matching rows
	 * @throws SystemException if a system exception occurred
	 */
	@SuppressWarnings("rawtypes")
	public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
		throws SystemException {
		return myExpectationPersistence.findWithDynamicQuery(dynamicQuery,
			start, end);
	}

	/**
	 * Performs a dynamic query on the database and returns an ordered range of the matching rows.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param dynamicQuery the dynamic query to search with
	 * @param start the lower bound of the range of model instances to return
	 * @param end the upper bound of the range of model instances to return (not inclusive)
	 * @param orderByComparator the comparator to order the results by
	 * @return the ordered range of matching rows
	 * @throws SystemException if a system exception occurred
	 */
	@SuppressWarnings("rawtypes")
	public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
		OrderByComparator orderByComparator) throws SystemException {
		return myExpectationPersistence.findWithDynamicQuery(dynamicQuery,
			start, end, orderByComparator);
	}

	/**
	 * Counts the number of rows that match the dynamic query.
	 *
	 * @param dynamicQuery the dynamic query to search with
	 * @return the number of rows that match the dynamic query
	 * @throws SystemException if a system exception occurred
	 */
	public long dynamicQueryCount(DynamicQuery dynamicQuery)
		throws SystemException {
		return myExpectationPersistence.countWithDynamicQuery(dynamicQuery);
	}

	/**
	 * Gets the my expectation with the primary key.
	 *
	 * @param exceptationId the primary key of the my expectation to get
	 * @return the my expectation
	 * @throws PortalException if a my expectation with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public MyExpectation getMyExpectation(long exceptationId)
		throws PortalException, SystemException {
		return myExpectationPersistence.findByPrimaryKey(exceptationId);
	}

	/**
	 * Gets a range of all the my expectations.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param start the lower bound of the range of my expectations to return
	 * @param end the upper bound of the range of my expectations to return (not inclusive)
	 * @return the range of my expectations
	 * @throws SystemException if a system exception occurred
	 */
	public List<MyExpectation> getMyExpectations(int start, int end)
		throws SystemException {
		return myExpectationPersistence.findAll(start, end);
	}

	/**
	 * Gets the number of my expectations.
	 *
	 * @return the number of my expectations
	 * @throws SystemException if a system exception occurred
	 */
	public int getMyExpectationsCount() throws SystemException {
		return myExpectationPersistence.countAll();
	}

	/**
	 * Updates the my expectation in the database. Also notifies the appropriate model listeners.
	 *
	 * @param myExpectation the my expectation to update
	 * @return the my expectation that was updated
	 * @throws SystemException if a system exception occurred
	 */
	public MyExpectation updateMyExpectation(MyExpectation myExpectation)
		throws SystemException {
		myExpectation.setNew(false);

		return myExpectationPersistence.update(myExpectation, true);
	}

	/**
	 * Updates the my expectation in the database. Also notifies the appropriate model listeners.
	 *
	 * @param myExpectation the my expectation to update
	 * @param merge whether to merge the my expectation with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
	 * @return the my expectation that was updated
	 * @throws SystemException if a system exception occurred
	 */
	public MyExpectation updateMyExpectation(MyExpectation myExpectation,
		boolean merge) throws SystemException {
		myExpectation.setNew(false);

		return myExpectationPersistence.update(myExpectation, merge);
	}

	/**
	 * Gets the profile local service.
	 *
	 * @return the profile local service
	 */
	public ProfileLocalService getProfileLocalService() {
		return profileLocalService;
	}

	/**
	 * Sets the profile local service.
	 *
	 * @param profileLocalService the profile local service
	 */
	public void setProfileLocalService(ProfileLocalService profileLocalService) {
		this.profileLocalService = profileLocalService;
	}

	/**
	 * Gets the profile remote service.
	 *
	 * @return the profile remote service
	 */
	public ProfileService getProfileService() {
		return profileService;
	}

	/**
	 * Sets the profile remote service.
	 *
	 * @param profileService the profile remote service
	 */
	public void setProfileService(ProfileService profileService) {
		this.profileService = profileService;
	}

	/**
	 * Gets the profile persistence.
	 *
	 * @return the profile persistence
	 */
	public ProfilePersistence getProfilePersistence() {
		return profilePersistence;
	}

	/**
	 * Sets the profile persistence.
	 *
	 * @param profilePersistence the profile persistence
	 */
	public void setProfilePersistence(ProfilePersistence profilePersistence) {
		this.profilePersistence = profilePersistence;
	}

	/**
	 * Gets the my expectation local service.
	 *
	 * @return the my expectation local service
	 */
	public MyExpectationLocalService getMyExpectationLocalService() {
		return myExpectationLocalService;
	}

	/**
	 * Sets the my expectation local service.
	 *
	 * @param myExpectationLocalService the my expectation local service
	 */
	public void setMyExpectationLocalService(
		MyExpectationLocalService myExpectationLocalService) {
		this.myExpectationLocalService = myExpectationLocalService;
	}

	/**
	 * Gets the my expectation remote service.
	 *
	 * @return the my expectation remote service
	 */
	public MyExpectationService getMyExpectationService() {
		return myExpectationService;
	}

	/**
	 * Sets the my expectation remote service.
	 *
	 * @param myExpectationService the my expectation remote service
	 */
	public void setMyExpectationService(
		MyExpectationService myExpectationService) {
		this.myExpectationService = myExpectationService;
	}

	/**
	 * Gets the my expectation persistence.
	 *
	 * @return the my expectation persistence
	 */
	public MyExpectationPersistence getMyExpectationPersistence() {
		return myExpectationPersistence;
	}

	/**
	 * Sets the my expectation persistence.
	 *
	 * @param myExpectationPersistence the my expectation persistence
	 */
	public void setMyExpectationPersistence(
		MyExpectationPersistence myExpectationPersistence) {
		this.myExpectationPersistence = myExpectationPersistence;
	}

	/**
	 * Gets the family member local service.
	 *
	 * @return the family member local service
	 */
	public FamilyMemberLocalService getFamilyMemberLocalService() {
		return familyMemberLocalService;
	}

	/**
	 * Sets the family member local service.
	 *
	 * @param familyMemberLocalService the family member local service
	 */
	public void setFamilyMemberLocalService(
		FamilyMemberLocalService familyMemberLocalService) {
		this.familyMemberLocalService = familyMemberLocalService;
	}

	/**
	 * Gets the family member remote service.
	 *
	 * @return the family member remote service
	 */
	public FamilyMemberService getFamilyMemberService() {
		return familyMemberService;
	}

	/**
	 * Sets the family member remote service.
	 *
	 * @param familyMemberService the family member remote service
	 */
	public void setFamilyMemberService(FamilyMemberService familyMemberService) {
		this.familyMemberService = familyMemberService;
	}

	/**
	 * Gets the family member persistence.
	 *
	 * @return the family member persistence
	 */
	public FamilyMemberPersistence getFamilyMemberPersistence() {
		return familyMemberPersistence;
	}

	/**
	 * Sets the family member persistence.
	 *
	 * @param familyMemberPersistence the family member persistence
	 */
	public void setFamilyMemberPersistence(
		FamilyMemberPersistence familyMemberPersistence) {
		this.familyMemberPersistence = familyMemberPersistence;
	}

	/**
	 * Gets the horoscope local service.
	 *
	 * @return the horoscope local service
	 */
	public HoroscopeLocalService getHoroscopeLocalService() {
		return horoscopeLocalService;
	}

	/**
	 * Sets the horoscope local service.
	 *
	 * @param horoscopeLocalService the horoscope local service
	 */
	public void setHoroscopeLocalService(
		HoroscopeLocalService horoscopeLocalService) {
		this.horoscopeLocalService = horoscopeLocalService;
	}

	/**
	 * Gets the horoscope remote service.
	 *
	 * @return the horoscope remote service
	 */
	public HoroscopeService getHoroscopeService() {
		return horoscopeService;
	}

	/**
	 * Sets the horoscope remote service.
	 *
	 * @param horoscopeService the horoscope remote service
	 */
	public void setHoroscopeService(HoroscopeService horoscopeService) {
		this.horoscopeService = horoscopeService;
	}

	/**
	 * Gets the horoscope persistence.
	 *
	 * @return the horoscope persistence
	 */
	public HoroscopePersistence getHoroscopePersistence() {
		return horoscopePersistence;
	}

	/**
	 * Sets the horoscope persistence.
	 *
	 * @param horoscopePersistence the horoscope persistence
	 */
	public void setHoroscopePersistence(
		HoroscopePersistence horoscopePersistence) {
		this.horoscopePersistence = horoscopePersistence;
	}

	/**
	 * Gets the my photo local service.
	 *
	 * @return the my photo local service
	 */
	public MyPhotoLocalService getMyPhotoLocalService() {
		return myPhotoLocalService;
	}

	/**
	 * Sets the my photo local service.
	 *
	 * @param myPhotoLocalService the my photo local service
	 */
	public void setMyPhotoLocalService(MyPhotoLocalService myPhotoLocalService) {
		this.myPhotoLocalService = myPhotoLocalService;
	}

	/**
	 * Gets the my photo remote service.
	 *
	 * @return the my photo remote service
	 */
	public MyPhotoService getMyPhotoService() {
		return myPhotoService;
	}

	/**
	 * Sets the my photo remote service.
	 *
	 * @param myPhotoService the my photo remote service
	 */
	public void setMyPhotoService(MyPhotoService myPhotoService) {
		this.myPhotoService = myPhotoService;
	}

	/**
	 * Gets the my photo persistence.
	 *
	 * @return the my photo persistence
	 */
	public MyPhotoPersistence getMyPhotoPersistence() {
		return myPhotoPersistence;
	}

	/**
	 * Sets the my photo persistence.
	 *
	 * @param myPhotoPersistence the my photo persistence
	 */
	public void setMyPhotoPersistence(MyPhotoPersistence myPhotoPersistence) {
		this.myPhotoPersistence = myPhotoPersistence;
	}

	/**
	 * Gets the counter local service.
	 *
	 * @return the counter local service
	 */
	public CounterLocalService getCounterLocalService() {
		return counterLocalService;
	}

	/**
	 * Sets the counter local service.
	 *
	 * @param counterLocalService the counter local service
	 */
	public void setCounterLocalService(CounterLocalService counterLocalService) {
		this.counterLocalService = counterLocalService;
	}

	/**
	 * Gets the resource local service.
	 *
	 * @return the resource local service
	 */
	public ResourceLocalService getResourceLocalService() {
		return resourceLocalService;
	}

	/**
	 * Sets the resource local service.
	 *
	 * @param resourceLocalService the resource local service
	 */
	public void setResourceLocalService(
		ResourceLocalService resourceLocalService) {
		this.resourceLocalService = resourceLocalService;
	}

	/**
	 * Gets the resource remote service.
	 *
	 * @return the resource remote service
	 */
	public ResourceService getResourceService() {
		return resourceService;
	}

	/**
	 * Sets the resource remote service.
	 *
	 * @param resourceService the resource remote service
	 */
	public void setResourceService(ResourceService resourceService) {
		this.resourceService = resourceService;
	}

	/**
	 * Gets the resource persistence.
	 *
	 * @return the resource persistence
	 */
	public ResourcePersistence getResourcePersistence() {
		return resourcePersistence;
	}

	/**
	 * Sets the resource persistence.
	 *
	 * @param resourcePersistence the resource persistence
	 */
	public void setResourcePersistence(ResourcePersistence resourcePersistence) {
		this.resourcePersistence = resourcePersistence;
	}

	/**
	 * Gets the user local service.
	 *
	 * @return the user local service
	 */
	public UserLocalService getUserLocalService() {
		return userLocalService;
	}

	/**
	 * Sets the user local service.
	 *
	 * @param userLocalService the user local service
	 */
	public void setUserLocalService(UserLocalService userLocalService) {
		this.userLocalService = userLocalService;
	}

	/**
	 * Gets the user remote service.
	 *
	 * @return the user remote service
	 */
	public UserService getUserService() {
		return userService;
	}

	/**
	 * Sets the user remote service.
	 *
	 * @param userService the user remote service
	 */
	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	/**
	 * Gets the user persistence.
	 *
	 * @return the user persistence
	 */
	public UserPersistence getUserPersistence() {
		return userPersistence;
	}

	/**
	 * Sets the user persistence.
	 *
	 * @param userPersistence the user persistence
	 */
	public void setUserPersistence(UserPersistence userPersistence) {
		this.userPersistence = userPersistence;
	}

	/**
	 * Performs an SQL query.
	 *
	 * @param sql the sql query to perform
	 */
	protected void runSQL(String sql) throws SystemException {
		try {
			DataSource dataSource = myExpectationPersistence.getDataSource();

			SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
					sql, new int[0]);

			sqlUpdate.update();
		}
		catch (Exception e) {
			throw new SystemException(e);
		}
	}

	@BeanReference(type = ProfileLocalService.class)
	protected ProfileLocalService profileLocalService;
	@BeanReference(type = ProfileService.class)
	protected ProfileService profileService;
	@BeanReference(type = ProfilePersistence.class)
	protected ProfilePersistence profilePersistence;
	@BeanReference(type = MyExpectationLocalService.class)
	protected MyExpectationLocalService myExpectationLocalService;
	@BeanReference(type = MyExpectationService.class)
	protected MyExpectationService myExpectationService;
	@BeanReference(type = MyExpectationPersistence.class)
	protected MyExpectationPersistence myExpectationPersistence;
	@BeanReference(type = FamilyMemberLocalService.class)
	protected FamilyMemberLocalService familyMemberLocalService;
	@BeanReference(type = FamilyMemberService.class)
	protected FamilyMemberService familyMemberService;
	@BeanReference(type = FamilyMemberPersistence.class)
	protected FamilyMemberPersistence familyMemberPersistence;
	@BeanReference(type = HoroscopeLocalService.class)
	protected HoroscopeLocalService horoscopeLocalService;
	@BeanReference(type = HoroscopeService.class)
	protected HoroscopeService horoscopeService;
	@BeanReference(type = HoroscopePersistence.class)
	protected HoroscopePersistence horoscopePersistence;
	@BeanReference(type = MyPhotoLocalService.class)
	protected MyPhotoLocalService myPhotoLocalService;
	@BeanReference(type = MyPhotoService.class)
	protected MyPhotoService myPhotoService;
	@BeanReference(type = MyPhotoPersistence.class)
	protected MyPhotoPersistence myPhotoPersistence;
	@BeanReference(type = CounterLocalService.class)
	protected CounterLocalService counterLocalService;
	@BeanReference(type = ResourceLocalService.class)
	protected ResourceLocalService resourceLocalService;
	@BeanReference(type = ResourceService.class)
	protected ResourceService resourceService;
	@BeanReference(type = ResourcePersistence.class)
	protected ResourcePersistence resourcePersistence;
	@BeanReference(type = UserLocalService.class)
	protected UserLocalService userLocalService;
	@BeanReference(type = UserService.class)
	protected UserService userService;
	@BeanReference(type = UserPersistence.class)
	protected UserPersistence userPersistence;
}